import Vue from 'vue'
import App from './App.vue'
// 引入样式文件
import './mobile/flexible'
import './styles/reset.css'


// 引入全局axios
// 网络请求 - 二次封装
import axios from 'axios'
axios.defaults.baseURL = "http://localhost:3000"
Vue.prototype.$axios = axios


// 引入组件
import Home from '@/views/Home'
import Layout from '@/views/Layout'
import Search1 from '@/views/Search'
import Play from '@/views/Play'


// 1. 引入模块
import Router from 'vue-router'

// 2.挂载到vue
Vue.use(Router)

// 3.配置规则
const routes = [
  {
    path: '/',
    redirect: '/layout',
  },
  {
    path: '/layout',
    redirect: '/layout/home',
    component: Layout,
    children: [
      {
        path: 'home',
        component: Home,
      },
      {
        path: 'search',
        component: Search1,
      },
    ]
  },

  {
    path: '/play',
    component: Play,
  },
]

// 4.添加规则
const router = new Router({ routes, mode: 'history' })

Vue.config.productionTip = false

// 底部导航组件引入
import { Tabbar, TabbarItem } from 'vant';
Vue.use(Tabbar);
Vue.use(TabbarItem);

// 顶部组件
import { NavBar } from 'vant';
Vue.use(NavBar);

// 图片组件
import { Image as VanImage } from 'vant';
Vue.use(VanImage);

// 引入layout布局
import { Col, Row } from 'vant';
Vue.use(Col);
Vue.use(Row);

// 单元格,推荐音乐
import { Cell, CellGroup } from 'vant';
Vue.use(Cell);
Vue.use(CellGroup);

// 字体图标
import { Icon } from 'vant';
Vue.use(Icon);

// 搜索组件
import { Search } from 'vant';
Vue.use(Search);

// 瀑布流加载
import { List } from 'vant';
Vue.use(List);








new Vue({
  router,
  render: h => h(App),
}).$mount('#app')
